/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rooster.chromosomeevaluator.rules;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jgap.IChromosome;
import org.rooster.chromosomeevaluator.common.ScheduleMetrix;
import org.rooster.chromosomeevaluator.rules.chromosome.TestChromosome;

/**
 *
 * @author Shanaka
 */
public class SameTaskForContinuousSlotsBonusRuletest extends TestCase{
    public SameTaskForContinuousSlotsBonusRuletest(String testName) {
        super(testName);

    }

    public static Test suite() {
        return new TestSuite(SameTaskForContinuousSlotsBonusRuletest.class);
    }

    public void testFitnessValueForRule() {
        double expectedPenaltyValue = 4/3;
        try {
            IChromosome cromosome = TestChromosome.getChromosomeForAllocationTable();
            ScheduleMetrix.getScheduleMetrixInstance().fillMetrix(cromosome);
            double real = new SameTaskForContinuousSlotsBonusRule().fitnessValueForRule(cromosome);
            assertEquals(expectedPenaltyValue,real);
        } catch (SQLException ex) {
            Logger.getLogger(DuplicateEmployeeForSameSectionSameTimeSlotPenaltyRuleTest.class.getName()).log(Level.SEVERE, null, ex);
        }   
    }
}
